<template>
	<view>
		<wyb-popup ref="popup" type="center" height="450" width="600" radius="6" :showCloseIcon="true">
				    <view class="popup-content">
				        <text class="header">请升级成为VIP用户</text>
							 <view>
							 	<checkbox-group >
							 		<label  @click="select(1)">
										<image class="vip" src="/static/vip.jpg" mode="aspectFit"></image>
							 			<checkbox class="gmvip"  value="1"   :checked="selected===1" />
							 		</label>
							 		<label  @click="select(2)">
										<image class="pos" src="/static/pos.jpg" mode="aspectFit"></image>
							 			<checkbox  class="gmpos" value="2" :checked="selected===2" />
							 		</label>
							 	</checkbox-group>
							 </view>
							 <view class="but-box">
								 <button  type="primary" @click="payment" size="mini">确定</button>
							 </view>
				    </view>
		</wyb-popup>
	</view>
</template>

<script>
	import wybPopup from '@/components/wyb-popup/wyb-popup.vue';
	export default {
		components: {wybPopup}, 
		data() {
			return {
				// gmpos:false,
				selected:1
			}
		},
		methods: {
			select(indexed){
				 this.selected=indexed;
			},
			//购买VIP会员
			payment(){
				this.$refs.popup.hide();
				if(this.selected==2){
					uni.navigateTo({
						url:"/pages/indexMallList/indexMallList"
					})
				}else{
				let params = {
					data:{address_id:-1,attrjson: null,collect_quantity: 0,content: "VIP会员",createtime:this.dateFormat("Y-m-d H:M:S",new Date()),id: 16,images: "/uploads/20201127/Fv7OVBpFwR-1XV0ICiReqlwWx7UT.png",name: "VIP会员",p_name: "VIP会员",price: "99.00",recommend_quantity: 0},
					sum: "99.00",
					address_id:-1
				};
				uni.setStorageSync('params',params)
				uni.navigateTo({
				  	url:'/pages/buyNow/buyNow?source=1&goods_type=pos'
				 }) 	
				}
			},
			show(){
				this.$refs.popup.show();
			},
			//修改购买内容
			// up_payment_parame(e){
			// 	let values = e.detail.value;
			// 	console.log(values);
			// 	if(values.length==2){
			// 		this.gmpos = true;
			// 	}else{
			// 		this.gmpos = false;
			// 	}
			// }
		},
		props:{
			
		}
	}
</script>

<style>
.header{
	 color: #0062CC;
	 display: inline-block;
	 width: 100%;
	 text-align: center;
	 margin-top: 30upx;
 }
 
 .vip,.pos{
	 margin-left: 58upx;
	 width:220upx;
	 height:220upx;
	 margin-top: 25upx;
 }
 .pos{
	 margin-left: -10upx;
 }
 .gmvip{
	 transform: translate(-132upx,4upx);
	 border: none;
 }
 .gmpos{
	 transform: translate(410upx,-50upx);
 }
 .but-box{
	width: 100%;
	text-align: center;
	margin-top: 40upx;
	transform: translate(0upx,-60upx);
 }
 .but-box button{
	 display: inline-block;
	 width: 250upx;
 }
</style>
